package com.yunji.ylexpiration.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//新增加一个类用来添加虚拟路径映射
@Configuration
public class MyPicConfig implements WebMvcConfigurer {
     @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/tximages/**").addResourceLocations("file:C:\\Users\\sss\\Desktop\\123\\ylexpiration\\src\\main\\resources\\static\\tximages\\");
         //和页面有关的静态目录都放在项目的static目录下
         registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
         //上传的图片在D盘下的OTA目录下，访问路径如：http://localhost:8080/xxx.jpg
    }
}
